/*
 * @Author: 陈俊升 761723995@qq.com
 * @Date: 2023-08-30 09:40:06
 * @LastEditors: 陈俊升 761723995@qq.com
 * @LastEditTime: 2023-12-13 09:55:02
 * @FilePath: /hr_new_vue3/src/apis/management/attendance/baseSetting/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/* 储存考勤-基础设置接口 */
import { ajaxService } from '@/utils/request';
import { ajaxUploadService } from '@/utils/requestUpload';

const env = import.meta.env;
// let baseURL = env.VITE_API_BASE_URL;
// const baseURL = 'http://192.168.31.129:39001';
// const baseURL = 'http://192.168.31.129:39001';
// const baseURL = env.VITE_APP_BASE_URL;
const baseURL = env.VITE_DEV_BASE_URL;
// const baseURL = 'http://192.168.31.129:39001';

// 获取假期类型
export function GetHolidayType(params: any) {
  return ajaxService({
    url: '/hr/work_attendance/basic_setting/holiday_setting/holiday_type/type/list',
    method: 'get',
    baseURL,
    params
  });
}

// 新增假期类型
export function PostHolidayType(data: any) {
  return ajaxService({
    url: '/hr/work_attendance/basic_setting/holiday_setting/holiday_type/type/add',
    method: 'post',
    baseURL,
    data
  });
}

// 查重假期类型
export function CheckHolidayType(params: any) {
  return ajaxService({
    url: '/hr/work_attendance/basic_setting/holiday_setting/holiday_type/type/repeat',
    method: 'get',
    baseURL,
    params
  });
}

// 修改假期类型
export function PutHolidayType(data: any) {
  return ajaxService(
    {
      url: '/hr/work_attendance/basic_setting/holiday_setting/holiday_type/type/update',
      method: 'put',
      baseURL,
      data
    },
    {
      message: '修改成功',
      mode: 'success'
    }
  );
}

// 删除假期类型
export function DelHolidayType(data: any) {
  return ajaxService({
    url: '/hr/work_attendance/basic_setting/holiday_setting/holiday_type/type/delete',
    method: 'delete',
    baseURL,
    data
  });
}
